/**
 * 
 */

 $(function(){
        $('.return img').click(
                function(){
                    $('.login').css('z-index','-1').css('opacity','0');
                    $('.content-detail-1 a,' +
                            '.content-detail-2,' +
                            '.content-detail-3,' +
                            '.content-detail-4,' +
                            '.content-detail-5,' +
                            '.content-detail-6,' +
                            '.content-detail-7').css('opacity','1');
                }
        );
        $('.content-detail-1 img,.content-detail-1 a').click(
                function(){
                    $('.login').css('z-index','1').css('opacity','1');
                    $('.content-detail-1 a,' +
                            '.content-detail-2,' +
                            '.content-detail-3,' +
                            '.content-detail-4,' +
                            '.content-detail-5,' +
                            '.content-detail-6,' +
                            '.content-detail-7').css('opacity','0');
                }
        );
    });
 
 
 
 $(document).ready(function(){
		$('.index img').click(function(){
			var cabinetId = $.session.get('cid');
			var page = $.session.get('page');//获取上个页面
			if(page == 'index'){
				location.href="index.jsp?cabinetId="+cabinetId;
			}else{
				location.href="./commdidties/findcid?cid="+cabinetId;
			} 
		});
		$('.content-detail-8').click(function(){
			$.session.set('userId','');
			location.href="./user/outlogin";
		});
	});

	$(document).ready(function(){
		var loadInit = $.getUrlParam("loadInit");
		var userId = $('#userlogin').val();
		if(loadInit == 1){
			alert('用户名不存在或密码不正确');
		}else{
				if(loadInit == 2){
					$('.content-detail-8').css('opacity','0');
					$('.content-detail-1 img').attr('src','images/ico-png/user-white.png');
					$('.content-detail-1 a').html('请登入');
			}else{
					if(userId=='NONE'  || userId == ''){
						$('.content-detail-8').css('opacity','0');
					
					}else{
						$.session.set('userId',userId);
						$('.content-detail-8').css('opacity','1');
						$('.content-detail-1 a').html('');
						$('.content-detail-1 img').attr('src','images/userphoto/18150166685.jpg');	
					}
				}
		}
	});
	
	$(function(){
		$('.content-detail-2').click(function(){
			window.location.href="./order/finduserorder?userId="+$.session.get('userId');
		});
	});
	
	
	
	
	
	
	